package com.my.relation;


public class Son{
	String name;
   /**
	 * @return the name
	 */
	public String getName() {
		return name;
	}
	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}
	//关联关系中作为成员变量的类一般会在类中赋值
    Father father = new Father();
    public void getGift(){
        System.out.println("从"+father.getName()+"获得礼物");
    }
}

